
class MockableWrapper:
    """
    A wrapper around mockable objects.
    """
    def __init__(self, callable):
        self.default_callable = callable
        self.callable = callable

    def mock(self, callable):
        """
        The mocking callable should be able to handle arguments passed to what it mocks.
        """
        self.callable = callable

    def mockValue(self, value):
        """
        The callable is mocked with a value.
        """
        def f(*args, **kwargs):
            return value
        self.callable = f

    def __call__(self, *args, **kwargs):
        return self.callable(*args, **kwargs)

    def reset(self):
        self.callable = self.default_callable

def mockable(callable):
    """
    A decorator around mockable objects or functions.
    """
    return MockableWrapper(callable)
